package com.project.entity;

import java.io.Serializable;
import javax.persistence.*;


/**
 * The persistent class for the PropForSale database table.
 * 
 */
@Entity
@Table(name="PropForSale")
@NamedQueries({
	@NamedQuery(name = "PropForSale.findAllPropForSale", query = "select pro from PropForSale pro"),
	@NamedQuery(name="PropForSale.searchSimple",query="select pro from PropForSale pro where (:title is null or pro.property.title like :title) and (:address is null or pro.property.address like :address) and (:type is null or pro.type like :type)"),
	@NamedQuery(name="PropForSale.searchAdvance",query="select pro from PropForSale pro where (pro.price between :priceMin and :priceMax) and (pro.bedroom between :bedRoomMin and :bedRoomMax and pro.bedroom<:bedRoomMax) and (pro.bathroom between :bathRoomMin and :bathRoomMax and pro.bathroom<:bathRoomMax)")
})
public class PropForSale implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PropID")
	private String propID;

	@Column(name="Bathroom")
	private int bathroom;

	@Column(name="Bedroom")
	private int bedroom;

    @Lob()
	@Column(name="Facility")
	private String facility;

	@Column(name="HasInterior")
	private boolean hasInterior;

	@Column(name="Payment")
	private String payment;

	@Column(name="Price")
	private double price;

	@Column(name="Square")
	private String square;

    @Lob()
	@Column(name="Transport")
	private String transport;

	@Column(name="Type")
	private String type;

	//bi-directional one-to-one association to Property
	@OneToOne
	@JoinColumn(name="PropID")
	private Property property;

    public PropForSale() {
    }

	public String getPropID() {
		return this.propID;
	}

	public void setPropID(String propID) {
		this.propID = propID;
	}

	public int getBathroom() {
		return this.bathroom;
	}

	public void setBathroom(int bathroom) {
		this.bathroom = bathroom;
	}

	public int getBedroom() {
		return this.bedroom;
	}

	public void setBedroom(int bedroom) {
		this.bedroom = bedroom;
	}

	public String getFacility() {
		return this.facility;
	}

	public void setFacility(String facility) {
		this.facility = facility;
	}

	public boolean getHasInterior() {
		return this.hasInterior;
	}

	public void setHasInterior(boolean hasInterior) {
		this.hasInterior = hasInterior;
	}

	public String getPayment() {
		return this.payment;
	}

	public void setPayment(String payment) {
		this.payment = payment;
	}

	public double getPrice() {
		return this.price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public String getSquare() {
		return this.square;
	}

	public void setSquare(String square) {
		this.square = square;
	}

	public String getTransport() {
		return this.transport;
	}

	public void setTransport(String transport) {
		this.transport = transport;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Property getProperty() {
		return this.property;
	}

	public void setProperty(Property property) {
		this.property = property;
	}
	
}